$(document).ready(function() {

    //client contact relationship 
    $("#client_submit_form").click(function() {
    	


        //alert('qweqweqwe');
        $("#client_submit_form").hide();
        $("#client_reset").hide();
        
        
        $("#contact_info").show();
        $("#relationship_info").hide();
        $("#client_info").hide();

        $.ajax({
            type: "POST",
            url: '/show/contact/insert_contact_submit',
            data: $("form#contact_info").serialize(),
            success: function(msg) {
                //alert(msg);

                //alert('//關西人寫到資料庫//');
                
                
                $("#contact_info").hide();
                $("#relationship_info").show();
                $("#client_info").hide();

                
                //alert( $("#relationship_info_form").serialize() );

                $.ajax({
                    type: "POST",
                    url: '/show/relationship/insert_relationship_submit',
                    data: $("#relationship_info_form").serialize(),
                    success: function(relatdata_data) {


						//alert('q');
                        
                        $("#contact_info").html('');
                        $("#relationship_info").html('');
                        $("#client_info").show();
                        
                        
                        alert('顧客新增成功');
                        
                        $("form#userinfo").submit();
                        
						



                        
                    }
                });





            }
        });
        
        
        

       
      

    });



    


});

